home *** CD-ROM | disk | FTP | other *** search
- ======================================
- DOS & Don'ts -- Part 33
-
- by James Gregory Welier
- ======================================
-
- Part B: The BAM block
-
-
- The BAM (Block Availability Map)
-
- block is track 18, block 0 of your
-
- 1541 disk. It has three main parts:
-
- (See map 2: the BAM.)
-
- 1. Directory link
- 2. BAM
- 3. Disk name and ID.
-
- --------------------------------------
- Section 1: Directory link.
- --------------------------------------
-
- The first two bytes of the BAM block
-
- contain the numbers of the track and
-
- block where the disk's directory
-
- starts. Whenever DOS wants to find
-
- something on the disk, it starts by
-
- looking here. Normally, the directory
-
- begins on track 18, block 1.
-
- --------------------------------------
- Section 2: BAM
- --------------------------------------
-
- The BAM keeps track of which parts of
-
- the disk are used and which parts are
-
- avialable for use by files.
-
- The block availability map takes up
-
- the 4th through the 143rd bytes of
-
- the BAM block -- a total of 140 bytes.
-
- Each track on the disk is represented
-
- by four bytes. (140/4 = 35! Exactly
-
- the number of tracks on a disk! What
-
- a coincidence!)
-
- Thus, bytes 4 through 7 represent
-
- track 1; bytes 8 through 11 represent
-
- track 2; and so on up to track 35,
-
- which is represented by bytes 140
-
- through 143.
-
- --------------------------------------
- Section 3: disk name and id.
- --------------------------------------
-
- Bytes 144 through 161 of the BAM block
-
- contain the disk name, filled out with
-
- shifted space characters (CHR$(160)).
-
- This is the name you gave your disk
-
- when you NEWed it.
-
- Bytes 162 and 163 are the disk ID.
-
- The two characters you see after the
-
- disk name when you look at a directory
-
- are the ID. You assign an ID when you
-
- NEW a disk.
-
- ======================================
- ======================================
-
- Map 2: the BAM: track 18, sector 0
-
- byte
- --------------------------------------
- 00 Track of first directory block.
- Its value is normally eighteen.
- 01 Sector of first directory block.
- Its value is normally one.
- 02 'A'
- 03 Zero
-
- -------------------------------------
- 04-143 BAM. Each group of four
- bytes in this range is used
- to represent the available
- space on an entire track.
- Each 4 bytes is a track
- bit map. See map 2a.
-
- byte byte byte
- 4=track 1: 8=track 2: 12=track 3
- 16=track 4: 20=track 5: 24=track 6
- 28=track 7: 32=track 8: 36=track 9
- . .
- . .
- . .
- 124=track 31:128=track 32:132=track 33
- 136=track 34:140=track 35:
-
-
- bytes
- --------------------------------------
- 144-161 Disk name followed by shifted
- spaces.
- 162-164 Disk id followed by a shifted
- space
- 165-166 "2a"
- 167-170 Shifted spaces
- 171-255 Unused - all zeros.
- --------------------------------------
-
- =======< continued in Part 34 >=======
-